package com.example.demo.controller;

import com.example.demo.service.SiteSettingsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class AIAssistantViewController {

    private final SiteSettingsService siteSettingsService;
    
    @Autowired
    public AIAssistantViewController(SiteSettingsService siteSettingsService) {
        this.siteSettingsService = siteSettingsService;
    }

    @GetMapping("/ai-assistant")
    public String aiAssistantPage(Model model) {
        // 获取AI助手背景图片设置
        String backgroundImage = siteSettingsService.getSettingValue("ai.assistant.background", "");
        model.addAttribute("backgroundImage", backgroundImage);
        
        // 获取AI助手背景图片透明度设置
        String backgroundOpacity = siteSettingsService.getSettingValue("ai.assistant.background.opacity", "0.95");
        model.addAttribute("backgroundOpacity", backgroundOpacity);
        
        return "ai-assistant";
    }
} 